const signing = {
	namespaced: true,
	state: {
		signingInfo: {
			type: '',
			base: {},
			alipay: {},
			wechat: {}
		},
		signingInfoDraft: {
			type: '',
			base: {},
			alipay: {},
			wechat: {}
		}
	},
	mutations: {
		// 首页-拓展商户-正式提交接口的信息
		signingInfo(state, signingInfo) {
			// 签约类型（个体工商类型，企业类型）
			if(signingInfo.type == 0 || signingInfo.type == 1){
				state.signingInfo.type = signingInfo.type;
			}
			// 支付宝和微信公共的签约信息
			if(signingInfo.base){
				state.signingInfo.base = signingInfo.base;
			}
			// 支付宝签约信息
			if(signingInfo.alipay){
				state.signingInfo.alipay = signingInfo.alipay;
			}
			// 微信签约信息
			if(signingInfo.wechat){
				state.signingInfo.wechat = signingInfo.wechat;
			}
		},
		// 首页-拓展商户-草稿信息
		signingInfoDraft(state, signingInfoDraft) {
			// 签约类型（个体工商类型，企业类型）
			if(signingInfoDraft.type == 0 || signingInfoDraft.type == 1){
				state.signingInfoDraft.type = signingInfoDraft.type;
			}
			// 支付宝和微信公共的签约信息
			if(signingInfoDraft.base){
				state.signingInfoDraft.base = signingInfoDraft.base;
			}
			// 支付宝签约信息
			if(signingInfoDraft.alipay){
				state.signingInfoDraft.alipay = signingInfoDraft.alipay;
			}
			// 微信签约信息
			if(signingInfoDraft.wechat){
				state.signingInfoDraft.wechat = signingInfoDraft.wechat;
			}
		}
	}
}
export default signing
